package cn.wlinker.video.monitor.utils;

import cn.hutool.core.thread.ThreadUtil;

import java.util.concurrent.*;

/**
 * 线程池工具类
 *
 * @author gxsjx
 * @version 1.0
 * @date 2025/5/3
 * Copyright © wlinker.cn
 */
public class ThreadPoolUtils {

    /**
     * 线程池
     */
    private static final ExecutorService executorService = new ThreadPoolExecutor(64, 128, 300L, TimeUnit.SECONDS,
            new SynchronousQueue<>(), ThreadUtil.newNamedThreadFactory("thread-pool-", true), new ThreadPoolExecutor.AbortPolicy());

    /**
     * 执行任务
     *
     * @param runnable
     */
    public static void execute(Runnable runnable) {
        executorService.execute(runnable);
    }

}
